﻿<%@ Page Title="Roles" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
 CodeBehind="bebidas.aspx.cs" Inherits="Restaurante.bebidas"%>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
         <p id="titulo"> Bebidas </p>
    </h2>

    <div class="contTabla">

        <asp:GridView ID="gvBebidas" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" CellPadding="4" DataKeyNames="Id_Bebida" 
            DataSourceID="Bebeidas" ForeColor="#333333" GridLines="None" 
            AllowPaging="True">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowSelectButton="True" />
                <asp:BoundField DataField="Id_Bebida" HeaderText="Id_Bebida" 
                    SortExpression="Id_Bebida" InsertVisible="False" ReadOnly="True" />
                <asp:BoundField DataField="Descripcion" HeaderText="Descripcion" 
                    SortExpression="Descripcion" />
                <asp:BoundField DataField="Tamanio" HeaderText="Tamanio" 
                    SortExpression="Tamanio" />
                <asp:BoundField DataField="Valor" HeaderText="Valor" SortExpression="Valor" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <asp:SqlDataSource ID="Bebeidas" runat="server" 
            ConnectionString="<%$ ConnectionStrings:BarCafe %>" 
            DeleteCommand="DELETE FROM [Bebida] WHERE [Id_Bebida] = @original_Id_Bebida" 
            InsertCommand="INSERT INTO [Bebida] ([Descripcion], [Tamanio], [Valor]) VALUES (@Descripcion, @Tamanio, @Valor)" 
            OldValuesParameterFormatString="original_{0}" 
            ProviderName="<%$ ConnectionStrings:BarCafe.ProviderName %>" 
            SelectCommand="SELECT [Descripcion], [Tamanio], [Valor], [Id_Bebida] FROM [Bebida]" 
            
            UpdateCommand="UPDATE [Bebida] SET [Descripcion] = @Descripcion, [Tamanio] = @Tamanio, [Valor] = @Valor WHERE [Id_Bebida] = @original_Id_Bebida">
            <DeleteParameters>
                <asp:Parameter Name="original_Id_Bebida" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="Descripcion" Type="String" />
                <asp:Parameter Name="Tamanio" Type="String" />
                <asp:Parameter Name="Valor" Type="Int64" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="Descripcion" Type="String" />
                <asp:Parameter Name="Tamanio" Type="String" />
                <asp:Parameter Name="Valor" Type="Int64" />
                <asp:Parameter Name="original_Id_Bebida" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </div>

     <div class="contTabla">
        <table>
        <tr>
            <td class="style1">
                <asp:Label ID="Label1" runat="server" Text="Ingrese la Descripción:"></asp:Label>
            </td>
            <td>
               <asp:TextBox ID="txbDesc" runat="server" MaxLength="50" ></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatortxbDesc" runat="server" ErrorMessage="La descripción de la bebida es requerida." ControlToValidate="txbDesc"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:Label ID="Label2" runat="server" Text="Ingrese el tamaño:"></asp:Label>
            </td>
            <td>
               <asp:TextBox ID="txtTamano" runat="server" MaxLength="4" ></asp:TextBox>
               <asp:RequiredFieldValidator ID="RequiredFieldValidatortxtTamano" runat="server" ErrorMessage="El tamaño de la bebida es requerido." ControlToValidate="txbDesc"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:Label ID="Label3" runat="server" Text="Ingrese el valor:"></asp:Label>
            </td>
            <td>
               <asp:TextBox ID="txtValor" runat="server" MaxLength="4" ></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatortxtValor" runat="server" ErrorMessage="El valor de la bebida es requerido." ControlToValidate="txbValor"></asp:RequiredFieldValidator>
            </td>
        </tr>
        </table>
         <br />
         <br />

        <asp:Button ID="btnAceptaComandar" runat="server" Text="Aceptar" 
             onclick="btnAceptaComandar_Click" />
            
        <asp:Button ID="btnCancelarComanda" runat="server" Text="Cancelar" 
             onclick="btnCancelarComanda_Click" />
            
    </div>

</asp:Content>